﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs"
    Inherits="ETestIT.UI.Users" Title="Untitled Page" %>

<%@ Register TagPrefix="uc" TagName="UserAddEdit" Src="~\AppControls\UserAddEdit.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2 id="PageTitle"><%= Title %></h2>
    <asp:LinkButton ID="createNewUser" Text="add new" runat="server" OnClick="BtnCreateNewUser_Clicked" />
    <br/><br/>
    <div>
        <asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="False" CssClass="easygrid" >
            <Columns>
               <asp:BoundField DataField="Name" HeaderText="Name"/>
               <asp:TemplateField HeaderText = "Actions">
                    <ItemTemplate>
                        <asp:LinkButton 
                                ID="lbtnEditUser" 
                                runat="server" 
                                Text="Edit"
                                CommandName="UserEdit" 
                                CommandArgument='<%#Eval("Id")%>' 
                                OnCommand="LnkEditCommand"/>
                        <asp:LinkButton 
                                ID="lbtnDeleteUser" 
                                runat="server" 
                                Text="Delete"
                                CommandName="UserDelete" 
                                CommandArgument='<%#Eval("Id")%>' 
                                OnCommand="LnkEditCommand"/>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <br />
    <div>
        <uc:UserAddEdit runat="server" Id="userAddEdit" Visible="false" />
    </div>
</asp:Content>
